

//
//  UIFont+FontSize.m
//  GYVVUser
//
//  Created by yangfan on 2019/1/16.
//  Copyright © 2019 gongyou04. All rights reserved.
//

#import "UIFont+FontSize.h"

@implementation UIFont (FontSize)
+ (UIFont *)pingFangFontOfSize:(CGFloat)fontSize {
    return [self pingFangFontOfSize:fontSize weight:GYFontWeightRegular];
}

+ (UIFont *)boldPingFangFontOfSize:(CGFloat)fontSize {
    return [self pingFangFontOfSize:fontSize weight:GYFontWeightMedium];
}

+ (UIFont *)pingFangFontOfSize:(CGFloat)fontSize weight:(GYFontWeight)weight {
    NSString *fontName = nil;
    switch (weight) {
        case GYFontWeightMedium:
            fontName = @"PingFang-SC-Medium";
            break;
        case GYFontWeightSemibold:
            fontName = @"PingFang-SC-Semibold";
            break;
        case GYFontWeightLight:
            fontName = @"PingFang-SC-Light";
            break;
        case GYFontWeightUltralight:
            fontName = @"PingFang-SC-Ultralight";
            break;
        case GYFontWeightThin:
            fontName = @"PingFang-SC-Thin";
            break;
        case GYFontWeightRegular:
        default:
            fontName = @"PingFang-SC-Regular";
            break;
    }
    return [UIFont fontWithName:fontName size:fontSize];
}
@end
